home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / graphics / polygo / polygone.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1992-01-05  |  5.9 KB  |  109 lines

  1. Form1
  2. PolyGone
  3. Form1
  4. Form_Click
  5. Shuffle
  6. DrawPolyQ
  7. Largest
  8. Smallest
  9. ScrNuma
  10. ScrWidthR
  11.     ScrHeight
  12. SCREENq
  13. TwoPi
  14. Ratio
  15. Lupe1
  16. OnScreen
  17. INKEY
  18. ColrW
  19. PrevColr*
  20. LoopEndt
  21. COLOR
  22. SLEEP
  23.     InnerLoop
  24. Form1
  25. fgcolr
  26.     ForeColor
  27. Height
  28. Width
  29. Form_Resize    
  30.     BackColor
  31. Drawing
  32. @    Form_Load>
  33. Orderj
  34. LastM
  35. LastJ~
  36. CLSFlag
  37. State
  38. ReScale
  39. NomSize
  40.     ErasePoly
  41. Bigger
  42. UnLoad
  43. Outer
  44. Form_LinkOpen
  45. Cancel
  46. Form_Paint
  47. Form_Unload
  48. WindowState
  49. ReColor
  50.  PolyGone was written by Jim Mack, CIS 76630,20121
  51.  It has no purpose other than to entertain, and is
  52.  not copyrighted.  If you modify this code, please
  53.  send me a copy so I can have some more fun too!
  54.  Start reading the code at Form_Load to follow the
  55.  flow.  The hierarchy is:
  56.  Loadc
  57.    : ReScale
  58.    : Outer
  59.  : DrawPoly
  60.  : Shuffle    
  61. Form_Click
  62.  Clicking on the form cause a Clear next passc
  63. DrawPoly
  64.  Draw the vertex connections alternately
  65.  clockwise and counterclockwise, on ai
  66.  random basis.
  67.  about half the time
  68. Shuffle
  69.  Randomize the order in which the vertices are accessed.
  70.  IAry() is an array containing vertex numbers.
  71.  Self-fill the array: I(9)=9, e.g.
  72.  Most of the time (about 90%), randomize the order
  73.  in which the points will be accessed, but once 
  74.  in a while, let it happen in order.
  75. Form_Resize
  76. Form_Load
  77.  Aspect ratio, =1 for "square" pixels
  78.  choose appropriate sizesi
  79.  Now just go do work forever
  80. ReScale
  81. if minimized, restrict range
  82. Outer
  83.  This is where the action takes place.
  84.  number currently on screenc
  85.  if another process wants to CLS
  86.  Select a polygon "order" based on the current
  87.  lowest and highest allowable values.  See
  88.  "ReScale" for how Lowest and Highest are sett
  89.  Choose a random color some distance from thet
  90.  current color
  91.  Don't allow BackColor unless the screen
  92.  has at least 10 polygons already on itn
  93.  Every so often (maybe 10% of the time)t
  94.  erase the images by drawing a special
  95.  polygon (of order "ErasePoly") in BackColor
  96.  But only do that if there are at least 
  97.  10 polygons already drawn.  Otherwise
  98.  just draw a new polygon over the last.
  99.  Most of the time (roughly 93%), chooseo
  100.  a new size and position for the newesto
  101.  polygon.z
  102. 333333
  103.  keep the center
  104.    on the screen
  105.  count this onen
  106.  Now draw the polygoni
  107.  If this was an ErasePoly, clear its rubbleh
  108. Form_Unload
  109.